package cn.hdustea.shopNavigation.ui.presenter

import cn.hdustea.shopNavigation.entity.Amusement
import cn.hdustea.shopNavigation.entity.Life
import cn.hdustea.shopNavigation.ui.contract.AmusementContract
import cn.hdustea.shopNavigation.ui.contract.LifeContract
import cn.hdustea.shopNavigation.ui.model.AmusementModel
import cn.hdustea.shopNavigation.ui.model.LifeModel
import com.hdustea.base.base.BasePresenter

/**
 * <pre>
 *     author : HuQiang
 *     time   : 2020/09/21
 *     desc   :
 *     version: 1.0
 * </pre>
 */
class AmusementPresenter(mView: AmusementContract.View) :
        BasePresenter<AmusementContract.View, AmusementContract.Model>(mView), AmusementContract.Presenter {

    override fun getModel(): AmusementContract.Model = AmusementModel()

    override fun getAmusementList(page: Int, isRefresh: Boolean) {

        mModel.getAmusementList(page, object : PresenterCallback<MutableList<Amusement>>() {

            override fun callback(data: MutableList<Amusement>) {
                mView?.dismissLoading()
                mView?.setAmusementList(data, isRefresh)
            }

        })
    }


} 